package com.smx.sync.config;

import com.smx.sync.service.SyncService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * SyncTaskInitializer
 *
 * @author 廖功旺
 * @version 1.0
 * @since 2025/6/24 15:53
 */
@Component
public class SyncTaskInitializer implements ApplicationRunner {

    private final SyncService syncService;

    public SyncTaskInitializer(SyncService syncService) {
        this.syncService = syncService;
    }

    @Override
    public void run(ApplicationArguments args) {
        // 在Spring Boot应用完全启动后才初始化同步任务
        syncService.createSyncTask();
    }
}
